#include <bits/stdc++.h>

int main() {
	for(int i = 1; i <= 10000000; ++i) {
		std::cerr << "#" << i << "...\n";
		system("./gen > song.in");
		system("./bf < song.in > song.ans");
		system("./song < song.in > song.out");
		assert(!system("diff -Z song.out song.ans"));
	}
}
